Skip to content

Add .gitignore templates to extension language scaffolding#6232

Merged
rajeshkamal5050 merged 2 commits intomainfrom
copilot/add-gitignore-generation
Dec 1, 2025
Merged

Add .gitignore templates to extension language scaffolding#6232
rajeshkamal5050 merged 2 commits intomainfrom
copilot/add-gitignore-generation

Conversation

Copy link
Contributor

Copilot AI commented Nov 18, 2025

When running azd x init, generated extension projects lacked .gitignore files, requiring manual creation for each new extension.

Changes

Added language-specific .gitignore templates to extension scaffolding directories:

  • Go: bin/ directory and standard Go patterns (already existed, updated to explicitly list bin/)
  • Python: bin/, build/, generated_proto/, virtual environments, bytecode
  • JavaScript: bin/, generated/, node_modules/
  • C#: bin/, obj/, Visual Studio user files

Templates are automatically copied during azd x init via existing copyAndProcessTemplates logic in init.go. No code changes required.

Example: After running azd x init --language python, the generated project now includes:

# Build output directory
bin/

# PyInstaller build artifacts
build/
dist/

# Generated protobuf files
generated_proto/

# Node modules
node_modules/
...

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: /home/REDACTED/work/azure-dev/azure-dev/cli/azd/azd x init --no-prompt --id test.extension --name Test Extension --capabilities custom-commands --language python (dns block)
    • Triggering command: ./azd ext --help (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[extension] azd x init should generate a .gitignore with sensible defaults to improve dev experience</issue_title>
<issue_description>When initializing a new extension, some folders should be ignored by Git. Generating the .gitignore file would save the extension developer some time and improve the experience.

Something like this:

Go

bin/

Python

bin/
build/
generated_proto/

Javascript

bin/
generated/
node_modules/

C Sharp

bin/
obj/

</issue_description>

<agent_instructions>Update the azd x init command in the developer extension to include a per language .gitignore file that gets added to the project output along with each generated sample project.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: wbreza <6540159+wbreza@users.noreply.github.com>
Copilot AI changed the title [WIP] Add .gitignore generation for azd x init command Add .gitignore templates to extension language scaffolding Nov 18, 2025
Copilot AI requested a review from wbreza November 18, 2025 00:20
@rajeshkamal5050 rajeshkamal5050 marked this pull request as ready for review December 1, 2025 19:22
@rajeshkamal5050 rajeshkamal5050 enabled auto-merge (squash) December 1, 2025 19:23
@JeffreyCA
Copy link
Contributor

/check-enforcer override

@rajeshkamal5050 rajeshkamal5050 merged commit ae0a8c5 into main Dec 1, 2025
18 of 23 checks passed
Copilot AI added a commit that referenced this pull request Dec 2, 2025
Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
hemarina added a commit that referenced this pull request Dec 2, 2025
* Initial plan

* Create changelog for v1.22.0 release

Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>

* Add additional PRs #6282, #6180, #6281 to v1.22.0 changelog

Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>

* Add PR #6232 to v1.22.0 changelog

Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>

* Update cli/azd/CHANGELOG.md

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: hemarina <104857065+hemarina@users.noreply.github.com>
Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
@JeffreyCA JeffreyCA deleted the copilot/add-gitignore-generation branch January 16, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[extension] azd x init should generate a .gitignore with sensible defaults to improve dev experience

4 participants